﻿Imports HMSLibrary
Imports HMSDataLayer
Imports WpfCheckListBox

Public Class PatientHistoryUserControl
    Implements IHMSData

    Public Property ActionMode As HMSLibrary.FormAction Implements HMSLibrary.IHMSData.ActionMode

    Dim _patientHistory As PatientHistory

    Public Sub AddNew() Implements HMSLibrary.IHMSData.AddNew
        _patientHistory = New PatientHistory
        ActionMode = FormAction.ADD
        Dim dataProvider As New MasterDataLayer()
        Dim lst As List(Of Lookups)

        lst = dataProvider.GetLookupList(LookupTypes.Immunization)
        For Each item In lst
            _patientHistory.immunizationItems.Add(New CheckedListBoxItem(item.Name, item.ID, False))
        Next
        ImmunizationCheckedListBox.ListBox.ItemsSource = _patientHistory.immunizationItems


        lst = dataProvider.GetLookupList(LookupTypes.Habits)
        For Each item In lst
            _patientHistory.HabitsItems.Add(New CheckedListBoxItem(item.Name, item.ID, False))
        Next
        HabitsCheckedListBox.ListBox.ItemsSource = _patientHistory.HabitsItems

        PastMedicalDataGrid.ItemsSource = _patientHistory.MedicalHistoryItems

        AllergyDataGrid.ItemsSource = _patientHistory.AllergyItems
    End Sub

    Public Sub BackView() Implements HMSLibrary.IHMSData.BackView

    End Sub

    Public Function DataValidation() As Boolean Implements HMSLibrary.IHMSData.DataValidation

    End Function

    Public Sub FindData() Implements HMSLibrary.IHMSData.FindData

    End Sub

    Public Property ID As Integer Implements HMSLibrary.IHMSData.ID

    Public Sub LoadData(ByVal ID As Integer) Implements HMSLibrary.IHMSData.LoadData

    End Sub

    Public Function SaveData() As Boolean Implements HMSLibrary.IHMSData.SaveData

    End Function

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

    End Sub
End Class
